import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Gao zhao xu
 * Date: 2023-10-15
 * Time: 10:53
 */
public class test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("1.============================");
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        binaryTree.levelOrder(root);
        System.out.println();
        System.out.println("2.============================");
        binaryTree.preOrder1(root);
        binaryTree.inOrder1(root);
        binaryTree.postOrder1(root);
        System.out.println("3.============================");
        System.out.println(binaryTree.preOrderTraversal(root));
        System.out.println(binaryTree.inOrderTraversal(root));
        System.out.println(binaryTree.postOrderTraversal(root));
        List<List<Character>> list = binaryTree.levelOrder1(root);
        System.out.println(list);
        System.out.println("4.============================");
        char[] arr = binaryTree.preOrder2(root);
        for (int i = 0; i < binaryTree.size(root); i++){
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        char[] arr1 = binaryTree.inOrder2(root);
        for (int i = 0; i < binaryTree.size(root); i++){
            System.out.print(arr1[i] + " ");
        }
        System.out.println();
        char[] arr2 = binaryTree.postOrder2(root);
        for (int i = 0; i < binaryTree.size(root); i++){
            System.out.print(arr2[i] + " ");
        }
        System.out.println();
        char[] arr3 = binaryTree.levelOrder2(root);
        for (int i = 0; i < binaryTree.size(root); i++){
            System.out.print(arr3[i] + " ");
        }
        System.out.println();
        System.out.println("5.============================");
        binaryTree.new_preOrder1(root);
        System.out.println(binaryTree.size(root));
        System.out.println(binaryTree.size1(root));
        System.out.println("6.============================");
        System.out.println(binaryTree.getLeafNodeCount(root));
        System.out.println(binaryTree.getLeafNodeCount1(root));
        System.out.println("7.============================");
        System.out.println(binaryTree.getKLevelNodeCount(root, 0));
        System.out.println("8.============================");
        System.out.println(binaryTree.getHeight(root));
        System.out.println(binaryTree.getDepth(root));
        System.out.println("9.============================");
        System.out.println(binaryTree.isCompleteTree(root));
        System.out.println("10.============================");
        System.out.println(binaryTree.rightLook(root));
    }
} 
